package com.wanxi.service.impl;

import com.wanxi.dao.PermissionDao;
import com.wanxi.dto.ResultDTO;
import com.wanxi.model.Permission;
import com.wanxi.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class PermissionServiceImpl implements PermissionService {
    @Autowired
    PermissionDao permissionDao;
    @Override
    public ResultDTO findAllPermission() {
        List<Permission> permissions = permissionDao.selectList(null);
        return ResultDTO.getDTO(permissions.size(),permissions);
    }
}
